/*
 * pulseseq.h
 *
 *  Created on: May 26, 2011
 *      Author: nzhao
 */

#ifndef PULSESEQ_H_
#define PULSESEQ_H_

#include "share/Usrdef.h"
#include "share/parameters.h"

//////////////////////////////////////////////////////////////////////////////////////////////////////////
/**\defgroup PULSE_SEQ Pulse Sequence
 *  @{*/

/////////////////////////////////////////////////////////////////////////////////
/*!@name General Properties of Pulse Sequence
 * These variables specify the general properties of the pulse sequence
 */
///@{
extern int     SEQ_NAME;				/**< 1 - "UDD"; 2 - "PDD" */
extern int		INTERVAL_NUM;			/**< Number of free evolution intervals*/
extern double	* TIME_SEQ_INTERVAL;	/**< free evolution intervals*/
extern double	* PULSE_TIMING;			/**< Pulse timings*/
extern int		* PULSE_SYMMETRY_MODE;	/**< Symmetry of pulse sequence*/
///@}

/////////////////////////////////////////////////////////////////////////////////
/*!@name Special Variables for CDD and Packaged Sequence
 * These variables specify the special properties of the CDD and Pack-sequence.
 */
///@{
extern int		CDD_ORDER;				/**< CDD order, if CDD applied*/
extern double	* PULSE_PACK_POSITION;	/**< package pulse position*/
extern int		MAX_PULSE_IN_PACK;		/**< max number in a package*/
extern int		PACK_PULSE_NUM;			/**< pulse number for packaged pulse*/
///@}

int     set_time_sequence();				/**<Derive the free evolution intervals from the input parameters.*/
double	getPulse(int n);					/**<Get relative pulse position for a give pulse.*/
double  cddpulse(int cdd_order, int k);		/**<Get CDD pulse position.*/
double 	packpulse(int n);					/**<Get Pack-sequence postion*/
int     get_CDD_pulse_num(int CDD_order);	/**<Calculated CDD pulse number for a given concatenation order.*/
void 	import_pulse_pack();				/**<Import the pulse package file.*/

/**@}*/

#endif /* PULSESEQ_H_ */

///////////////////////////////////////////////////////////////////////////////////////
/*!\fn int     set_time_sequence()
 * Derive the free evolution intervals from the input parameters.
 */
